package com.meilai.project.controller.web.report.vo;

import com.meilai.project.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

/**
 * @author xchen
 * @since 2022-04-09
 */
@Data
@ApiModel
public class WeekSummaryDateRangeExt implements Serializable {
    @ApiModelProperty("开始日期")
    private LocalDate beginDate;
    @ApiModelProperty("结束日期")
    private LocalDate endDate;
    @ApiModelProperty("此时间段占用数量")
    private Integer occupyCount;

    @ApiModelProperty("时间段内的全部空闲点位总数（非当前楼盘楼层）")
    private Long vacancy_count;
    @ApiModelProperty("时间段内的全部占用点位总数（非当前楼盘楼层）")
    private Long occupy_count;
    @ApiModelProperty("时间段内的全部占用百分比（非当前楼盘楼层）")
    private BigDecimal occupy_percentage;

    @ApiModelProperty("时间段内的全部上刊数（非当前楼盘楼层）")
    private Long publish_count;

    @ApiModelProperty("时间段内的全部上刊百分比（非当前楼盘楼层）")
    private BigDecimal publish_percentage;

    @ApiModelProperty("是否有占用")
    private boolean hasOccupy = true;
    @ApiModelProperty("是否是上上周")
    private boolean isTwoWeekAgo = false;
    @ApiModelProperty("是否是当前周或者未来周")
    private boolean isCurrentWeekOrFuture = false;

    @ApiModelProperty("此时间段客户占用情况")
    List<WeekSummaryCustomerExt> customerOccupyInfo;

    public String getDateRangeDesc() {
        return DateUtil.formatDate(beginDate) + "-" + DateUtil.formatDate(endDate);
    }
}
